package com.ruoyi.logistic.service.impl;

import com.github.pagehelper.PageHelper;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.logistic.domain.NetworkPullUniform;
import com.ruoyi.logistic.domain.PageDate;
import com.ruoyi.logistic.domain.vo.NetworkPullUniformSearchVo;
import com.ruoyi.logistic.mapper.NetworkPullUniformMapper;
import com.ruoyi.logistic.service.INetworkPullUniformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;
@Service
public class NetworkPullUniformServiceImpl implements INetworkPullUniformService {
    @Autowired
    private NetworkPullUniformMapper networkPullUniformMapper;
    @Override
    public List<NetworkPullUniform> selectAll(PageDate pageDate) {
        PageHelper.startPage(pageDate);
        return networkPullUniformMapper.selectAll();
    }

    @Override
    public Boolean insert(NetworkPullUniform networkPullUniform) {
        networkPullUniform.setUpdateBy(SecurityUtils.getLoginUser().getUserId());
        networkPullUniform.setCreateBy(SecurityUtils.getLoginUser().getUserId());
        return networkPullUniformMapper.insert(networkPullUniform);
    }

    @Override
    public Boolean update(NetworkPullUniform networkPullUniform) {
        networkPullUniform.setUpdateBy(SecurityUtils.getLoginUser().getUserId());
        return networkPullUniformMapper.update(networkPullUniform);
    }

    @Override
    public Boolean deleteById(Integer id) {
        return null;
    }

    @Override
    public NetworkPullUniform findById(Integer id) {
        return null;
    }

    @Override
    public List<NetworkPullUniform> search(NetworkPullUniformSearchVo networkPullUniformSearchVo) {
        PageHelper.startPage(networkPullUniformSearchVo.getPageDate());
        return networkPullUniformMapper.search(networkPullUniformSearchVo);
    }
}
